package com.jrx.anytxn.param.job.bactchlimitadjust.step;

import com.jrx.anytxn.param.constant.Constant;
import com.jrx.anytxn.param.entity.BtLimitAdjustInfo;
import com.jrx.anytxn.param.mapper.ext.ExtBtLimitAdjustInfoMapper;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 批量调额writer
 *
 * @author : zhenghaopu
 * 2020/1/6
 */
public class BatchLimitAdjustStep2Reader extends MyBatisPagingItemReader<BtLimitAdjustInfo> {

    public BatchLimitAdjustStep2Reader(SqlSessionFactory sqlSessionFactory, Integer pageSize){
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.param.mapper.ext.ExtBtLimitAdjustInfoMapper.selectListByMqStatusForBatch");
        Map<String, Object> map = new HashMap<>();
        map.put("mqStatus", Constant.MQ_SATTUS_0);
        setParameterValues(map);
    }

}
